import axios from './axios'
import qs from 'qs'

export function addNewInventory(inventory) { // 新增盘库
    return axios.post('/check_inventory/manage/add_check_inventory_record.do', qs.stringify(inventory))
        .then(res => Promise.resolve(res.data))
}

export function inventoryRecord({partsId, belongModule, warehouse}) {
    return axios.get('/check_inventory/manage/show_check_inventory_record_list.do', {
        params: {
            partsId, belongModule, warehouse
        }
    }).then(res => Promise.resolve(res.data))
}

export function deleteInventoryRecord(id) {
    return axios.get('/check_inventory/manage/delete_check_inventory_record.do', {
        params: {id}
    }).then(res => Promise.resolve(res.data))
}

// 禁用或者启用配件
export function banUnbanPart(ban) {
    return axios.get('/optimization_inventory/manage/enable_or_disable_parts_inventory.do', {
        params: ban
    }).then(res => Promise.resolve(res.data))
}